@file:Suppress("unused")

package com.hjh.tool.extension

import android.graphics.Bitmap
import android.graphics.Canvas
import android.view.SurfaceView
import androidx.core.graphics.createBitmap

/**
 * @author： hjh
 * @createDate： 2025/6/10 13:59
 * @description：
 * @qq： 3472903821
 * @version: 1.0
 */
private fun surfaceView() {}

/**
 * 获取图层的 bitmap
 */
fun SurfaceView.getBitmap(): Bitmap {
    val bitmap = createBitmap(width, height)
    val canvas = Canvas(bitmap)
    draw(canvas)
    return bitmap
}